﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace DesktopShortcutMonitor.Model
{
    /// <summary>
    /// 每个被监控程序的配置
    /// </summary>
    public class SingleConfig : INotifyPropertyChanged
    {
        private string _checkLinkNamePattern = "AutoFrame";
        private bool _checkContainFile = false;
        private string _checkContainFileName = "Autoframe.ini";

        /// <summary>
        /// 被监控程序的快捷方式名字
        /// </summary>
        public string CheckLinkNamePattern
        {
            get
            {
                return _checkLinkNamePattern;
            }
            set
            {
                _checkLinkNamePattern = value;
                OnPropertyChanged();
            }
        }

        /// <summary>
        /// 是否检测被监控程序的所在目录是否包含某文件
        /// </summary>
        public bool CheckContainFile
        {
            get
            {
                return _checkContainFile;
            }
            set
            {
                _checkContainFile = value;
                OnPropertyChanged();
            }
        }

        /// <summary>
        /// 被监控程序的所在同级目录中包含某文件的名字
        /// </summary>
        public string CheckContainFileName
        {
            get
            {
                return _checkContainFileName;
            }
            set
            {
                _checkContainFileName = value;
                OnPropertyChanged();
            }
        }


        public SingleConfig(string name = "AutoFrame")
        {
            CheckLinkNamePattern = name;
        }

        public event PropertyChangedEventHandler PropertyChanged;
        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
